//#pragma once
#ifndef __MYSTDIO_H__
#define __MYSTDIO_H__ 

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include <unistd.h>
#include <stdlib.h>
#include<string.h>

#define SIZE 1024
#define FLUSH_NOW 1
#define FLUSH_LINE 2
#define FLUSH_ALL 4

typedef struct IO_FILE{
    int fileno;
    int flag;
    //char inbuffer[SIZE];//输入缓冲区
    //int in_pos;
    char outbuffer[SIZE];//输出缓冲区
    int out_pos;
}_FILE;

_FILE* _fopen(char* filename, const char* flag);
ssize_t _fwrite(_FILE *fp, const void *s, size_t len);
void _fclose(_FILE* fp);

#endif 
